package com.tiantai.system.service.impl;

import java.util.List;
import com.tiantai.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tiantai.system.mapper.TeaEnvAssessmentMapper;
import com.tiantai.system.domain.TeaEnvAssessment;
import com.tiantai.system.service.ITeaEnvAssessmentService;

/**
 * 环境健康评估主Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-21
 */
@Service
public class TeaEnvAssessmentServiceImpl implements ITeaEnvAssessmentService 
{
    @Autowired
    private TeaEnvAssessmentMapper teaEnvAssessmentMapper;

    /**
     * 查询环境健康评估主
     * 
     * @param id 环境健康评估主主键
     * @return 环境健康评估主
     */
    @Override
    public TeaEnvAssessment selectTeaEnvAssessmentById(Long id)
    {
        return teaEnvAssessmentMapper.selectTeaEnvAssessmentById(id);
    }

    /**
     * 查询环境健康评估主列表
     * 
     * @param teaEnvAssessment 环境健康评估主
     * @return 环境健康评估主
     */
    @Override
    public List<TeaEnvAssessment> selectTeaEnvAssessmentList(TeaEnvAssessment teaEnvAssessment)
    {
        return teaEnvAssessmentMapper.selectTeaEnvAssessmentList(teaEnvAssessment);
    }

    /**
     * 新增环境健康评估主
     * 
     * @param teaEnvAssessment 环境健康评估主
     * @return 结果
     */
    @Override
    public int insertTeaEnvAssessment(TeaEnvAssessment teaEnvAssessment)
    {
        teaEnvAssessment.setCreateTime(DateUtils.getNowDate());
        return teaEnvAssessmentMapper.insertTeaEnvAssessment(teaEnvAssessment);
    }

    /**
     * 修改环境健康评估主
     * 
     * @param teaEnvAssessment 环境健康评估主
     * @return 结果
     */
    @Override
    public int updateTeaEnvAssessment(TeaEnvAssessment teaEnvAssessment)
    {
        teaEnvAssessment.setUpdateTime(DateUtils.getNowDate());
        return teaEnvAssessmentMapper.updateTeaEnvAssessment(teaEnvAssessment);
    }

    /**
     * 批量删除环境健康评估主
     * 
     * @param ids 需要删除的环境健康评估主主键
     * @return 结果
     */
    @Override
    public int deleteTeaEnvAssessmentByIds(Long[] ids)
    {
        return teaEnvAssessmentMapper.deleteTeaEnvAssessmentByIds(ids);
    }

    /**
     * 删除环境健康评估主信息
     * 
     * @param id 环境健康评估主主键
     * @return 结果
     */
    @Override
    public int deleteTeaEnvAssessmentById(Long id)
    {
        return teaEnvAssessmentMapper.deleteTeaEnvAssessmentById(id);
    }
}
